Skip to content

pgrep: The pattern is too long (more than 15 characters) and should be able to match pid correctly.#617

Merged
cakebaker merged 2 commits intouutils:mainfrom
Franklin-Qi:bugfix-#121-long-length-pattern-matching-pids-is-avaiable
Feb 9, 2026
Merged

pgrep: The pattern is too long (more than 15 characters) and should be able to match pid correctly.#617
cakebaker merged 2 commits intouutils:mainfrom
Franklin-Qi:bugfix-#121-long-length-pattern-matching-pids-is-avaiable

Conversation

@Franklin-Qi
Copy link
Copy Markdown
Contributor

The PIDs should be obtained in advance. If the PIDs exist, it means the pattern matches, and there should be no length error.

Closes: #121

@Franklin-Qi Franklin-Qi closed this Feb 4, 2026
@Franklin-Qi Franklin-Qi reopened this Feb 4, 2026
@dezgeg
Copy link
Copy Markdown
Contributor

dezgeg commented Feb 5, 2026

Would be better to add the check to find_matching_pids (I think), calling collect_matched_pids() will essentially halve performance of the program

@Franklin-Qi
Copy link
Copy Markdown
Contributor Author

Franklin-Qi commented Feb 5, 2026

Would be better to add the check to find_matching_pids (I think), calling collect_matched_pids() will essentially halve performance of the program

@dezgeg Thanks for the feedback. Calling the collect_matched_pids function twice does indeed impact performance. Moving the length error information to the subsequent find_matching_pids might be a better idea.

@Franklin-Qi Franklin-Qi force-pushed the bugfix-#121-long-length-pattern-matching-pids-is-avaiable branch 2 times, most recently from aadf322 to 872c3cc Compare February 5, 2026 07:27
…e able to match pid correctly.

The PIDs should be obtained in advance. If the PIDs exist, it means the pattern matches, and there should be no length error.
@Franklin-Qi Franklin-Qi force-pushed the bugfix-#121-long-length-pattern-matching-pids-is-avaiable branch from 872c3cc to 54fbe8c Compare February 6, 2026 08:39
@cakebaker cakebaker merged commit 64be323 into uutils:main Feb 9, 2026
16 checks passed
@cakebaker
Copy link
Copy Markdown
Contributor

Thanks for your PR!

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (7b77e2f) to head (54fbe8c).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #617   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pgrep: should show an error message if pattern is longer than 15 chars and there's no match

3 participants